package 笔试.vivo笔试.第二题回文字符串;

import java.util.Scanner;

//判断是不是回文字符串，在最多删除一个字符的情况下，是则输出第一种情况，不是输出false
public class Main
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        StringBuffer sb = new StringBuffer(line);
        StringBuffer sb1 = new StringBuffer(line);

        int delcharIndex=0;
        StringBuffer reverse = sb1.reverse();
        if (sb.equals(reverse))
        {
            System.out.println(sb.toString());
            return;
        }
        else
        {
            int p1=0;
            int p2=0;
            int delcnt=0;
            char delchar = 0;
            while (p1<sb.length()&&p2<reverse.length())
            {
                if (sb.charAt(p1)==reverse.charAt(p2))
                {
                    p1++;
                    p2++;
                }
                else
                {
                    if (delcnt<1)
                    {
                        delchar=sb.charAt(p1);
                        delcharIndex=p1;
                        p1++;
                        delcnt++;
                    }
                    else if (reverse.charAt(p2)==delchar)
                    {
                        p2++;
                    }
                    else
                    {
                        System.out.println(false);
                        return;
                    }
                }
            }
            System.out.println(reverse.delete(delcharIndex, delcharIndex + 1));
        }
    }
}
